package cc.git.liuyan.customeraiagent.core.provider.giteeai.embeddingmodel;

import cc.git.liuyan.customeraiagent.core.embeddingmodel.EmbeddingModel;
import cc.git.liuyan.customeraiagent.core.embeddingmodel.abstrct.AbstractEmbeddingModelProvider;
import cc.git.liuyan.customeraiagent.core.provider.giteeai.embeddingmodel.bce.BceV1GiteeAiEmbeddingModel;
import cc.git.liuyan.customeraiagent.core.provider.giteeai.embeddingmodel.bgem3.BgeM3GiteeAiEmbeddingModel;

public class GiteeAiEmbeddingModelProvider extends AbstractEmbeddingModelProvider {

    public GiteeAiEmbeddingModelProvider(GiteeAiEmbeddingModelProviderInfo providerInfo) {
        super(providerInfo, () -> new GiteeAiEmbeddingModelApiClient(providerInfo));
    }

    //bge-m3 北京智源人工智能研究院 长文本/中文(推荐)
    //bce-embedding-base_v1 有道 稠密向量
    @Override
    protected EmbeddingModel createEmbeddingModel(String modelName) {
        if ("bge-m3".equals(modelName)) {
            return new BgeM3GiteeAiEmbeddingModel(modelName, 1024, (GiteeAiEmbeddingModelApiClient) this.apiClient);
        } else if ("bce-embedding-base_v1".equals(modelName)) {
            return new BceV1GiteeAiEmbeddingModel(modelName, 768, (GiteeAiEmbeddingModelApiClient) this.apiClient);
        } else {
            throw new IllegalArgumentException("请使用ModelName: bge-m3");
        }
    }

}
